import React, {Component} from "react";
import {connect} from 'react-redux';
import Counter from "../components/counter";
import {increment, decrement} from "../redux/actions";

/**
 * 容器组件
 */

function mapStateToProps(state) {
    return {
        count: state
    }
}

function mapDispatchToProps(dispatch) {
    return {
        increment: (number) => dispatch(increment(number)),
        decrement: (number) => dispatch(decrement(number)),
    }
}

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(Counter)